using System.Collections.Generic;
using ProtoModels;

public class TableTennisGiftHandlerConfig : GGMessageHandlerConfig
{
	public class GGFacebookGiftHandler : GGServerMessageHandlerBase
	{
		public override void Execute(ServerMessages.GGServerMessage.Attachment attachment)
		{
			GGDebug.DebugLog("facebook gift");
			WalletManager walletManager = GGPlayerSettings.instance.walletManager;
			BehaviourSingleton<EnergyManager>.instance.GainEnergy(attachment.args[0].intArg);
			walletManager.AddCurrency(CurrencyType.coins, attachment.args[1].intArg);
			walletManager.AddCurrency(CurrencyType.ggdollars, attachment.args[2].intArg);
		}
	}

	public class GGFacebookSocialRequestHandler : GGServerMessageHandlerBase
	{
		public override void Execute(ServerMessages.GGServerMessage.Attachment attachment)
		{
			GGDebug.DebugLog("facebook social request");
			PlayerStatsManager statsManager = GGPlayerSettings.instance.statsManager;
			statsManager.playerStats.UpdateAttribute(attachment.args[0].floatArg, 3);
			statsManager.playerMood.UpdateMood(attachment.args[1].floatArg);
		}
	}

	public override Dictionary<string, GGServerMessageHandlerBase> GetHandlers()
	{
		Dictionary<string, GGServerMessageHandlerBase> dictionary = new Dictionary<string, GGServerMessageHandlerBase>();
		dictionary.Add("AcceptGift", new GGFacebookGiftHandler());
		dictionary.Add("AcceptSocial", new GGFacebookSocialRequestHandler());
		return dictionary;
	}
}
